package com.lancoo.klgcourseware.ui.adapter;

import android.os.Parcelable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import com.lancoo.klgcourseware.base.BaseKlgFragment;

import java.util.List;



/**
 * Created by pengmi on 2018/11/21.
 * Description:fragment适配器
 */

public class ViewPagerFragmentAdapter extends FragmentStatePagerAdapter {
	List<BaseKlgFragment> list;
	
	public ViewPagerFragmentAdapter(FragmentManager fm, List list) {
		super(fm);
		this.list=list;
	}
	@Override
	public BaseKlgFragment getItem(int arg0) {
		return list.get(arg0);
	}
	@Override
	public int getCount() {
		return list.size();
	}
	
//	public boolean canScrollVertically(int position, int direction) {
//        return  getItem(position).canScrollVertically(direction);
//    }
	@Override
	public Parcelable saveState() {
	return null;
}
}
